//
//  ViewController.swift
//  表情键盘
//
//  Created by 耐克了解了 on 12/4/17.
//  Copyright © 2017年 耐克了解了. All rights reserved.
//

import UIKit



class ViewController: UIViewController {

    @IBOutlet weak var textView: UITextView!
    
    fileprivate lazy var emoticonVC : EmoticonController = EmoticonController(emoticonCallBack: { [weak self](emoticon) in
        
        self?.textView.insertEmoticon(emoticon: emoticon)
        
    })
    
   
    
    override func viewDidLoad() {
        super.viewDidLoad()

        textView.inputView = emoticonVC.view
        
//        let manager = EmoticonManager()
//        
//        for package in manager.packages {
//            for emoticon in package.emoticons {
//                
//               // print(emoticon)
//            }
//        }
//        //print(manager)
   }
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        
        textView.becomeFirstResponder()
    }

    
    @IBAction func sendBtnClick(_ sender: Any) {
        
        print(textView.getRmoticonString())
    }
}
